// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.AsyncSearch;

public partial class AsyncSearchNamespacedClient : Elastic.Clients.Elasticsearch.NamespacedClientProxy
{
	/// <summary>
	/// <para>
	/// Initializes a new instance of the <see cref="Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchNamespacedClient"/> class for mocking.
	/// </para>
	/// </summary>
	protected AsyncSearchNamespacedClient() : base()
	{
	}

	internal AsyncSearchNamespacedClient(Elastic.Clients.Elasticsearch.ElasticsearchClient client) : base(client)
	{
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id id)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse Delete(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse> DeleteAsync(Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse> DeleteAsync(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchResponse, Elastic.Clients.Elasticsearch.AsyncSearch.DeleteAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument> Get<TDocument>(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument> Get<TDocument>(Elastic.Clients.Elasticsearch.Id id)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument> Get<TDocument>(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>> GetAsync<TDocument>(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.GetAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Id id)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse Status(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse> StatusAsync(Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse> StatusAsync(Elastic.Clients.Elasticsearch.Id id, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor(id);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse> StatusAsync(Elastic.Clients.Elasticsearch.Id id, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestDescriptor(id);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequest, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusResponse, Elastic.Clients.Elasticsearch.AsyncSearch.AsyncSearchStatusRequestParameters>(request, cancellationToken);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest request)
	{
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument> Submit<TDocument>()
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(Elastic.Clients.Elasticsearch.Indices? indices)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument> Submit<TDocument>(Elastic.Clients.Elasticsearch.Indices? indices, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse> Submit<TDocument, TDocumentResponse>()
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse> Submit<TDocument, TDocumentResponse>(System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse> Submit<TDocument, TDocumentResponse>(Elastic.Clients.Elasticsearch.Indices? indices)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse> Submit<TDocument, TDocumentResponse>(Elastic.Clients.Elasticsearch.Indices? indices, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequest<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest request, System.Threading.CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(Elastic.Clients.Elasticsearch.Indices? indices, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>> SubmitAsync<TDocument>(Elastic.Clients.Elasticsearch.Indices? indices, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocument>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>> SubmitAsync<TDocument, TDocumentResponse>(System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>> SubmitAsync<TDocument, TDocumentResponse>(System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>();
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>> SubmitAsync<TDocument, TDocumentResponse>(Elastic.Clients.Elasticsearch.Indices? indices, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}

	public virtual System.Threading.Tasks.Task<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>> SubmitAsync<TDocument, TDocumentResponse>(Elastic.Clients.Elasticsearch.Indices? indices, System.Action<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>> action, System.Threading.CancellationToken cancellationToken = default)
	{
		var builder = new Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestDescriptor<TDocument>(indices);
		action.Invoke(builder);
		var request = builder.Instance;
		request.BeforeRequest();
		return DoRequestAsync<Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequest, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchResponse<TDocumentResponse>, Elastic.Clients.Elasticsearch.AsyncSearch.SubmitAsyncSearchRequestParameters>(request, cancellationToken);
	}
}